package com.zhengbo.flink.demo.base.codis;


import java.util.Map;
import java.util.Set;

/**
 * The interface Codis service.
 */
public interface CodisService {
    /**
     * Set string.
     *
     * @param key   the key
     * @param value the value
     * @return the string
     */
    String set(final String key, String value);

    /**
     * Sets .
     *
     * @param key     the key
     * @param seconds the seconds
     * @param value   the value
     * @return the
     */
    String setex(final String key, final int seconds, final String value);

    /**
     * Get string.
     *
     * @param key the key
     * @return the string
     */
    String get(final String key);

    /**
     * Decr long.
     *
     * @param key the key
     * @return the long
     */
    Long decr(final String key);

    /**
     * Decr by long.
     *
     * @param key     the key
     * @param integer the integer
     * @return the long
     */
    Long decrBy(final String key, final long integer);

    /**
     * Incr by long.
     *
     * @param key     the key
     * @param integer the integer
     * @return the long
     */
    Long incrBy(final String key, final long integer);

    /**
     * Incr long.
     *
     * @param key the key
     * @return the long
     */
    Long incr(final String key);

    /**
     * Del long.
     *
     * @param key the key
     * @return the long
     */
    Long del(String key);
    Long dels(String... keys) ;
    Long delPipeline(String... keys);

    /**
     * Expire long.
     *
     * @param key     the key
     * @param seconds the seconds
     * @return the long
     */
    Long expire(final String key, final int seconds);

    /**
     * Ttl long.
     *
     * @param key the key
     * @return the long
     */
    Long ttl(final String key);

    /**
     * Sets .
     *
     * @param key   the key
     * @param value the value
     * @return the
     */
    Long setnx(final String key, final String value);

    String hget(final String key, final String field);

	/**
	 *获取key对应的完整的hash数据
	 * @param hkey
	 * @return map(field, value)
	 */
	Map<String, String> hgetAll(final String hkey);

	Long hset(final String key, final String field, final String value);



	/**
	 * 判断key是否存在
	 * @param key
	 * @return
	 */
	Boolean exists(final String key);

    Set<String> smembers(final String key);

//    public String mset(final String... keysvalues) ;
//    public Long msetnx(final String... keysvalues) ;
//    public String hget(final String key, final String field);
//    public Long hsetnx(final String key, final String field, final String value);
//    public String hmset(final String key, final Map<String, String> hash);
//    public List<String> hmget(final String key, final String... fields);
//    public List<String> mget(final String... keys);


}
